package com.tl.project.provider.service;

import com.tl.project.provider.dao.UserDao;
import com.tl.project.provider.entity.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserService{
    @Autowired
    private UserDao userDao;

    /*
     * 查询所有
     * */
    public List<User> getAll(){
        return userDao.getAll();
    };

    /*
     * 根据id查找单个User
     * */
    public User getUserById(int id){
        return userDao.getUserById(id);
    };
    /*
     * 根据id删除User
     * */
    public int delUserById(int id){
        return userDao.delUserById(id);
    }
    /*
     * 增加User
     * */
    public int addUser(User user){
        return userDao.addUser(user);
    };
    /*
     * 修改User
     * */
    public int updateUser(User user){
        return userDao.updateUser(user);
    };
}
